/*  ---- Day 2, TASK 1 -----
 *  Learning goals:
 *    - Setting up low level interrupts
 *	  - The sei() command
 *    - Example usage of an ISR-function
 */

#include <avr/io.h>
//Include this header-file to use interrupts on AVR
#include <avr/interrupt.h>

//Define the ports on the ATMega1284p

#define LED_PORT PORTB
#define LED_DDR  DDRB

#define SWITCH_PORT PORTB
#define SWITCH_DDR  DDRB
#define SWITCH_PIN  PINB

#define SW0  0
#define SW1  1
#define LED2 2
#define LED3 3


int main(void){
	
	//Set the leds as outputs

	//Enable pullups on the switches

	//Set pin-change-interrupt to trigger on negative edge
	
	//Enable interrupts on both switch- pins 




	//Enable global interrupts
	sei();

	/* sei() enables all interrupts globally,
	 * can use cli() to disable interrups globally.
	*/

	//Infinite running loop
	for(;;){
		//Do nothing, all the pin-toggling is happening in the interrupt
	}
}

/*
 *	This is the standard way of defining an interrupt with AVR-GCC;
 *	ISR defines an interrupt (similar to a function in C), however, the
 *	interrupt only gets called when the interrupts happen. In this
 *	example, the interrupt routine (as stated in many textbooks) gets
 *	called every time a pin changes on PORTD and PORTR.
*/

//Interrupt vector for PORTB
//ISR(/*Insert interrupt-vector name here*/){

	/*Insert toggle code here*/

//}

